package labuladong;

public class IsPrime {

    public static void main(String[] args) {
        System.out.println(countPrimes(100));
    }

    private static Integer countPrimes(int n) {
        int count = 0;
        for (int i = 2; i < n; i++)
            if (isPrim(i)) count++;
        return count;
    }

    private static boolean isPrim(int n) {

        for (int i = 2; i < n; i++)
            if (n % i == 0)
                // 有其他整除因子
                return false;
        return true;
    }

}
